#ifndef FACEWORK_H
#define FACEWORK_H

#include <QObject>
#include "face.h"
#include <QString>
#include <string>
#include <sqlitehelper.h>
#include <vector>

class Facework : public QObject
{
    Q_OBJECT
public:
    explicit Facework(QObject *parent = 0);

    void runfaceone(QString sourcefacetext,cv::Mat &faceimage);//单一比对
    void runfaceall(cv::Mat &faceimage);//多个对比
    void runncnn(cv::Mat faceimage);
    void getFeat(cv::Mat faceimage);
    void stringToMat(QString str,ncnn::Mat& m);

private:
    cv::Mat peopleface;
    ncnn::Net facedistinnet;
    ncnn::Extractor ex;
    int faceflag=0;//是否识别
    int facecount=0;//识别次数
    SQLiteHelper helper = SQLiteHelper(QString("people.db"));
    std::vector<QString> allfeats;//特征
    std::vector<QString> allnames;//姓名

    int allfeatscount=0;//数据库人脸数
    int zhixindu = 40;

signals:
    void sendName(QString facename);
    void sendFeat(ncnn::Mat feat);
public slots:
    void getZhixindu(int value);
};

#endif // FACEWORK_H
